//
// Created by robin on 4/7/16.
//

#ifndef SQLITETEST_COLUMN_H
#define SQLITETEST_COLUMN_H

#include <string>
#include "DataType.h"
#include "SQLFlag.h"
using std::string;

namespace duomai {
    namespace im {

        class Column {
        public:

            Column(const string column_name);

            Column(const string column_name, DataType column_type, int flags = FLAG_NONE);

            Column(const Column& column);

            Column & operator=(const Column &column);

            const string getColumnName() const;

            DataType getColumnType() const;

            const string getColumnTypeString() const;

            int getColumnFlag() const;

            void setIndex(int index);

            int getIndex() const;

            bool isPrimaryKey() const;

            bool isNotNULL() const;

            bool isUnique() const;

            string toSQLCreate();


        private:
            string columnName;
            DataType columnType;
            int columnFlag;
            int index_; //index of ColumnSet
        };
    }
}


#endif //SQLITETEST_COLUMN_H
